import style from './index.module.css';
import React from 'react';
import {routerRedux} from 'dva/router';
import logo from '@/assets/img/logo.svg';
import projectConfig from '@/config/project.config';

export default props => {
    const logoToggle = () => {
        const {dispatch} = props;
        dispatch(routerRedux.push('/'));
    };
    return (
        <div className={style.logo} onClick={logoToggle}>
            <img className={style.icon} src={logo} alt="" />
            <h1 className={style.text} style={{color: '#1890ff'}}>
                {projectConfig.projectName}
            </h1>
        </div>
    );
};
